﻿
using System.Data.SQL.Linq.Provider;
namespace System.Data.SQL.Linq
{
    #region ConflictMode
    /// <summary>
    /// Used to specify how a submit should behave when one 
    /// or more updates fail due to optimistic concurrency 
    /// conflicts.
    /// </summary> 
    public enum ConflictMode
    {
        /// <summary>
        /// Fail immediately when the first change conflict is encountered.
        /// </summary> 
        FailOnFirstConflict,
        /// <summary> 
        /// Only fail after all changes have been attempted. 
        /// </summary>
        ContinueOnConflict
    }
    #endregion

    #region RefreshMode
    /// <summary>
    /// Used to specify a value synchronization strategy. 
    /// </summary>
    public enum RefreshMode
    {
        /// <summary> 
        /// Keep the current values.
        /// </summary> 
        KeepCurrentValues,
        /// <summary>
        /// Current values that have been changed are not modified, but
        /// any unchanged values are updated with the current database 
        /// values.  No changes are lost in this merge.
        /// </summary> 
        KeepChanges,
        /// <summary>
        /// All current values are overwritten with current database values, 
        /// regardless of whether they have been changed.
        /// </summary>
        OverwriteCurrentValues
    }
    #endregion
 
    //////////////////////////////////////////////////////////////////////////
    public partial class DataContext : IDisposable
    {
        private bool disposed;

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        protected virtual void Dispose(bool disposing)
        {

        }

        public void CheckDispose()
        {
            if (disposed) throw new InvalidOperationException();
        }
    }

    public partial class DataContext
    {
        public IProvider Provider { get; private set; }

        public Table<TEntity> GetTable<TEntity>() where TEntity : class
        {
            CheckDispose();
            throw new NotImplementedException();
        }
    }
}
